<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>login</title>
    <link href="css/login.css" rel="stylesheet">
    <!--引入cookiejs文件-->
    <script src="./js/jquery.min.js"></script>
    <script src="./js/jquery.cookie.js"></script>
</head>

<script type="text/javascript">

    //执行填操作，页面加载完成后，先从cookie中获取用户名，如果存在，则填充到表单中
    //$符号代表是jquery对象简写,
    $(function () {

        //获取cookie
        var username = $.cookie("username");
        var password = $.cookie("password");

        //判断cookie是否存在
        if(username != null && password != null)
        {
            $("#username").val(username);
            $("#password").val(password);
            $("#remember").attr("checked",true);
        }else {


            $("#username").val("");
            $("#password").val("");
        }

    })



</script>


<body>
<div id="loginDiv">
    <form action="/servlet-loginCase2/login" id="form" method="post">
        <h1 id="loginMsg">LOGIN IN</h1>
        <p>Username:<input id="username" name="username" type="text"></p>

        <p>Password:<input id="password" name="password" type="password"></p>

        <p>Remember:<input id="remember" name="remember" type="checkbox" value="1" ></p>
        <div id="subDiv">
            <input type="submit" class="button" value="login up">
            <input type="reset" class="button" value="reset">&nbsp;&nbsp;&nbsp;
            <a href="register.html">没有账号？点击注册</a>
        </div>
    </form>
</div>

</body>
</html>